/**
 * @file head file for tools.c
 *
 **/

#ifndef TOOLS_H
#define TOOLS_H

/**
 * Computes combination n choose k
 *
 */
unsigned long long nChoosek(unsigned n, unsigned k);


/**
 * Given a skew generator polynomial, returns the generator matrix
 *
 * @gen_poly	skew generator polynomial
 * @n	code length
 *
 * @return	generator matrix
 **/
mat_ZZ_pE SQ_gen_matrix(const ZZ_pEX& ,int);

/**
 * Generates a list of all messages of length k with weight j in GF(2)
 *
 * @list list of vectors, Note: memory must be preallocated for the list of size [k choose j,k]
 * @k	length of messages 
 * @j	weight
 *
 * @return size of the list
 *
 **/
int binary_msg_generator(vec_ZZ_pE* ,int ,int ,int horizontal_index=0,int vertical_index=0);


/**
 *  A counter that increments the input vector in binary by 1.
 *
 *  In other words this is the implementation of a digital full adder. For example, if input is [0 1 0 1] it outputs [0 1 1 0].  
 *
 **/
vec_ZZ_p binary_inc(vec_ZZ_p );


#endif
